#!/usr/bin/python

# a test script to show how the alvar and its library can be used
# make sure that opencv1.0 is in the path, and the _alvar.so is in the same folder as this file

import alvar
MAX_NUM_MARKERS = 50

# initialize the memory to keep the markers
alvar.init(MAX_NUM_MARKERS)

# call the alvar main function and detect the markers, the number of detected markers is returned
num_markers = alvar.get_markers("test4.jpg")

# print corners and their ids
for i in range (0,num_markers):
    print "Marker ", alvar.get_id(i), ":"
    for j in range (0,4):
        print "   Corner ", j, " at: (", alvar.get_corners(i,j).x, " , ", alvar.get_corners(i,j).y, ")"

#alvar.show_markers()

# if the memory is not release, next time alvar.init() is called, we'll have a memory leak
alvar.release()
